package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {



    List<ShoppingCart> shoppSelectById(ShoppingCart shoppingCart);


    @Update("update shopping_cart set number=#{number} where id=#{id}")
    void shoppUpdateNumber(ShoppingCart shoppingCart);


    void insert(ShoppingCart shoppingCart);


    void delete(Long id);

    @Delete("delete from shopping_cart where dish_id=#{dishId}")
    void deleteDish(Long dishId);

    @Delete("delete from shopping_cart where setmeal_id=#{setmealId}")
    void deleteSetmeal(Long setmealId);


    /**
     * 批量插入购物车数据
     *
     * @param shoppingCartList
     */
    void insertBatch(List<ShoppingCart> shoppingCartList);

}
